home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / python-support / gnome-games-data / gnome_sudoku / gnome_sudoku.py < prev    next >
Encoding:
Python Source  |  2009-04-14  |  428 b   |  23 lines

  1. # -*- coding: utf-8 -*-
  2. import sys
  3.  
  4. # Ignore any exceptions writing to stdout using print statements
  5. class SafeStdout:
  6.     def __init__(self):
  7.         self.stdout = sys.stdout
  8.     
  9.     def fileno(self):
  10.         return self.stdout.fileno()
  11.  
  12.     def write(self, data):
  13.         try:
  14.             self.stdout.write(data)
  15.         except:
  16.             pass
  17.  
  18. sys.stdout = SafeStdout()
  19.  
  20. def start_game ():
  21.     import main
  22.     main.start_game()
  23.